/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        height: 350px;
    }
    
    .slide-content h2 {
        font-size: 40px;
    }
    
    .slide-content p {
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        max-width: none;
    }
    
    .nav-list {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-list a {
        padding: 12px 15px;
    }
    
    .hero-section {
        height: 300px;
    }
    
    .slide-content h2 {
        font-size: 32px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px 0;
    }
    
    .header-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo a {
        font-size: 20px;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .search-box {
        order: 2;
    }
    
    .user-actions {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-list li {
        width: 100%;
        text-align: center;
    }
    
    .nav-list a {
        display: block;
        padding: 15px;
        border-bottom: 1px solid #e9ecef;
    }
    
    .hero-section {
        height: 250px;
    }
    
    .slide-content h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .slide-content p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .cta-btn {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-card {
        padding: 30px 15px;
    }
    
    .category-card i {
        font-size: 36px;
        margin-bottom: 15px;
    }
    
    .category-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .category-card p {
        font-size: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .product-card {
        border-radius: 8px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-name {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .product-price {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .product-meta {
        font-size: 11px;
        margin-bottom: 10px;
    }
    
    .add-to-cart-btn {
        padding: 10px;
        font-size: 12px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .game-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    #gameCanvas {
        width: 100%;
        height: auto;
    }
    
    .game-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .game-controls .btn {
        flex: 1;
        min-width: 80px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .hero-section {
        height: 200px;
    }
    
    .slide-content h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .slide-content p {
        font-size: 12px;
        margin-bottom: 15px;
    }
    
    .cta-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .category-card {
        padding: 20px 15px;
    }
    
    .category-card i {
        font-size: 32px;
        margin-bottom: 10px;
    }
    
    .category-card h3 {
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    .category-card p {
        font-size: 11px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .product-image {
        height: 120px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    .product-price {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .product-meta {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    .add-to-cart-btn {
        padding: 8px;
        font-size: 11px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 98%;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .game-container {
        gap: 15px;
    }
    
    .game-info h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .game-info p {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .score-display,
    .discount-info {
        padding: 10px;
        margin-bottom: 10px;
        font-size: 14px;
    }
    
    .game-instructions {
        padding: 10px;
        font-size: 12px;
    }
    
    .game-instructions p {
        margin-bottom: 3px;
    }
    
    .notification {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 4px;
    }
    
    .loading p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 180px;
    }
    
    .slide-content h2 {
        font-size: 18px;
    }
    
    .slide-content p {
        font-size: 11px;
    }
    
    .cta-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .category-card {
        padding: 15px 10px;
    }
    
    .category-card i {
        font-size: 28px;
    }
    
    .category-card h3 {
        font-size: 13px;
    }
    
    .category-card p {
        font-size: 10px;
    }
    
    .product-image {
        height: 100px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 12px;
    }
    
    .product-price {
        font-size: 13px;
    }
    
    .product-meta {
        font-size: 9px;
    }
    
    .add-to-cart-btn {
        padding: 6px;
        font-size: 10px;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 99%;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-body {
        padding: 10px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .btn-large {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .game-info h3 {
        font-size: 16px;
    }
    
    .game-info p {
        font-size: 13px;
    }
    
    .score-display,
    .discount-info {
        padding: 8px;
        font-size: 13px;
    }
    
    .game-instructions {
        padding: 8px;
        font-size: 11px;
    }
    
    .notification {
        top: 5px;
        right: 5px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .loading-spinner {
        width: 35px;
        height: 35px;
        border-width: 3px;
    }
    
    .loading p {
        font-size: 13px;
    }
}

/* 横屏适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        height: 150px;
    }
    
    .slide-content h2 {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    .slide-content p {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .cta-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .modal-content {
        margin: 2% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .game-container {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    #gameCanvas {
        width: 300px;
        height: 300px;
    }
}

/* 高分辨率屏幕适配 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image img,
    .main-image img,
    .thumbnail-item img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 打印样式 */
@media print {
    .header,
    .main-nav,
    .footer,
    .modal,
    .notification,
    .loading {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .product-card,
    .cart-item,
    .order-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .btn {
        display: none !important;
    }
    
    a {
        text-decoration: none;
        color: inherit;
    }
    
    .product-price,
    .total-price,
    .price-value {
        color: #000 !important;
        font-weight: bold;
    }
}

/* 无障碍访问优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* 暗色主题适配 */
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    .header {
        background: linear-gradient(135deg, #2c3e50, #34495e);
    }
    
    .main-nav {
        background: #2c3e50;
        border-bottom-color: #34495e;
    }
    
    .nav-list a {
        color: #e0e0e0;
    }
    
    .nav-list a:hover,
    .nav-list a.active {
        color: #3498db;
        border-bottom-color: #3498db;
    }
    
    .product-card,
    .cart-item,
    .checkout-section,
    .order-summary {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .product-name,
    .item-name,
    .section-header h2 {
        color: #e0e0e0;
    }
    
    .product-price,
    .price-value {
        color: #3498db;
    }
    
    .footer {
        background: #1a1a1a;
        border-top-color: #34495e;
    }
    
    .modal-content {
        background: #2c3e50;
        color: #e0e0e0;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        background: #34495e;
        border-color: #4a5f7a;
        color: #e0e0e0;
    }
    
    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
        border-color: #3498db;
    }
}
